// CppStudy.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <map>
#include <utility>
#include <list>
#include <vector>
#include <set>
#include <string>
#include <iostream>

class CMyKey
{
public:
	CMyKey(){};
	CMyKey(const CMyKey& src)
	{
		a = src.a;
		b = src.b;
	}
	~CMyKey(){};


	int a;
	int b;
};

inline bool operator<(const CMyKey& k1, const CMyKey& k2)
{
	return k1.a < k2.a;
}

int listpos(void)
{
	std::list<int> s1;
	s1.push_back(10);
	s1.push_back(11);
	s1.push_back(12);
	std::list<int>::const_iterator Iter = s1.begin();
	std::list<int>::const_iterator Iter2 = Iter;
	Iter++;
	s1.erase(Iter2);
	int em = *Iter;
	Iter++;
	int em2 = *Iter;
	return 0;
}

void dowhiletest()
{
	int i=0;
	do
	{
		i++;
		if (i <= 100)
			continue;
		i+= 5;
	}while(i>100);
}

int _tmain(int argc, _TCHAR* argv[])
{
	std::map<CMyKey,int> testMap;
	CMyKey key;
	key.a = 100;
	key.b = 120;

	listpos();

	testMap[key] = 100;
	std::set<int> testset;
	testset.insert(10);
	testset.insert(20);
	testset.insert(15);
	testset.insert(5);
	testset.insert(100);
	testset.insert(11);
	std::set<int>::const_iterator it = testset.begin();
	while(it!= testset.end())
	{
		std::cout<<(*it)<<'\n';
		it++;
	}

	dowhiletest();


	


	return 0;
}

